<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2024/11/22 0022
 * Time: 14:05
 */

namespace app\admin\validate;


use think\Validate;

class Book extends Validate
{
    protected $rule = [
        'catid' => 'require',
        //'bno' => 'require',
        'bname' => 'require',
        'thumb' => 'require',
        'author' => 'require',
        'publish' => 'require',
        'total'  => 'require|number',
        'price|float'  => 'require',
    ];

    protected $message = [
        'catid.require' => '分类不能为空',
        //'bno.require' => '编号不能为空',
        'bname.require' => '名称不能为空',
        'thumb.require' => '封面不能为空',
        'author.require' => '作者不能为空',
        'publish.require' => '出版社不能为空',
        'total.require' => '库存不能为空',
        'total.number' => '库存必须为整数',
        'price.require' => '售价不能为空',
        'price.float' => '售价必须大于0',
    ];
}